<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableHuzhiqiangTemp extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //测试会员积分用的用户模型
        Schema::create('test_users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();
            $table->char('avatar_url')->nullable()->comment('头像url');
            $table->char('wechat_name')->nullable()->comment('微信号');
            $table->char('alias')->nullable()->comment('昵称');
            $table->char('no')->nullable()->comment('绑定设备号');
            $table->char('card')->nullable()->comment('卡号');
            $table->float('accumulation_point')->default(0)->comment('累计积分');
            $table->float('point')->default(0)->comment('可用积分');
        });

//        Schema::create('m_users', function($collection)
//        {
//            $collection->index('name');
//
//            $collection->unique('email');
//        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('test_users');
    }
}
